package com.gitee.feizns.quickstart.web.restful;

import com.gitee.feizns.quickstart.domain.page.PageAo;
import com.gitee.feizns.quickstart.domain.page.PageRecordsVo;

import java.io.Serializable;
import java.util.List;

/**
 * un support restful service executor
 * @author feizns
 * @since 2024/12/4
 */
public class UnSupportRestExecutor implements RestExecutor {

    @Override
    public <T> T deleteById(Class<T> recordType, Serializable id) {
        throw unSupportedOperationException();
    }

    @Override
    public <T> long delete(Class<T> recordType, Object ao) {
        throw unSupportedOperationException();
    }

    @Override
    public boolean existsId(Class<?> recordType, Serializable id) {
        throw unSupportedOperationException();
    }

    @Override
    public <T> List<T> create(Class<T> recordType, Object... aos) {
        throw unSupportedOperationException();
    }

    @Override
    public <T> T putById(Class<T> recordType, Object ao, Serializable id) {
        throw unSupportedOperationException();
    }


    @Override
    public <T> T putById(T record, Serializable id) {
        throw unSupportedOperationException();
    }

    @Override
    public <T> List<T> put(Class<T> recordType, Object... aos) {
        throw unSupportedOperationException();
    }

    @Override
    public <T> T patchById(T record, Serializable id) {
        throw unSupportedOperationException();
    }

    @Override
    public <T> long patch(T record, Object ao) {
        throw unSupportedOperationException();
    }

    @Override
    public <T> T getById(Class<T> recordType, Serializable id) {
        throw unSupportedOperationException();
    }

    @Override
    public <T> PageRecordsVo<T> page(Class<T> recordType, PageAo page, Object... aos) {
        throw unSupportedOperationException();
    }

    /**
     * throw un support restful service executor
     */
    private static UnsupportedOperationException unSupportedOperationException() {
        return new UnsupportedOperationException("不支持该操作");
    }

}
